

function push_edit(tid,old,val,type){
	if(!type){type = 1;}
	if(!val){val = old;}
	var title = Alang.alias_edit;
	var html = '';
	html = Ahtml.tag('table',{'class':'-table'},
		Ahtml.tag('tr',{},
			Ahtml.tag('td',{},Alang.alias+':')+
			Ahtml.tag('td',{},Ahtml.tag('input',{type:'text',name:'save[alias]',value:val}))
		)+
		Ahtml.tag('tr',{},
			Ahtml.tag('td',{},'')+
			Ahtml.tag('td',{},
				Ahtml.tag('input',{type:'hidden',name:'save[rid]',value:tid})+
				Ahtml.tag('input',{type:'hidden',name:'save[type]',value:type})+
				Ahtml.tag('input',{type:'submit',name:'',value:Alang.save})
			)
		)+
		Ahtml.tag('tr',{},
			Ahtml.tag('td',{},'PING')+
			Ahtml.tag('td',{},
				Ahtml.tag('input',{type:'button',onclick:'alias_ping(\'baidu\','+tid+')',value:Alang.baidu})+
				Ahtml.tag('input',{type:'button',onclick:'alias_ping(\'google\','+tid+')',value:Alang.google})
			)
		)
	);
	html = Ahtml.tag('form',{method:'post',action:'',onsubmit:'alias_save();return false;','class':'alias_form'},html);
	var obj=Object();
	obj.id='ajax_alias_edit';
	obj["class"]='acan_win dis_none';
	obj.css={height:'150px',width:'200px'};
	obj._close={onclick:'Acan.close(\''+obj.id+'\')','class':'-close'};//关闭按钮
	Acan.base.win(obj,title,html);
}
function alias_save(){
	var data = jQuery('.alias_form').serialize();
	jQuery.ajax({
		async : false,
		type:"POST",url:'plugin.php?id=alias:post',data:data,
		beforeSend: function(){Acan.alert(Alang.ajax_start);},
		ajaxSend: function(){Acan.alert(Alang.ajax_send);},
		success: function(data){
			if(data==1){
				Acan.alert(Alang.up_success,1000);
			}else{
				Acan.alert(Alang.no_change,1000);
			}
		}
	});
}
function push_list_chkall(t){
	var jbj = jQuery('._list :checkbox');
	if(t==1) jbj.attr('checked','checked');
	if(t==2) jbj.removeAttr('checked');
}
function push_list_delall(t){
if(!confirm(Alang.sure_del_alias)){return;}
	var jbj = jQuery('._list :checkbox:checked');
	var ids = '';
	jbj.each(function(i){
		ids += jQuery(this).val()+',';
	});
	var data = {ids:ids.substr(0,ids.length-1),act:'del'};
	jQuery.ajax({
		async : false,
		type:"POST",url:form_url,data:data,
		beforeSend: function(){Acan.alert(Alang.ajax_start);},
		ajaxSend: function(){Acan.alert(Alang.ajax_send);},
		success: function(data){
			Acan.alert(Alang.del_success,1000);
			setTimeout('Acan.url.refresh()',1000);
		}
	});
}
function push_list_send(){
	if(!confirm(Alang.sure_send_push)){return;}
	var jbj = jQuery('._list :checkbox:checked');
	var ids = '';
	jbj.each(function(i){
		ids += jQuery(this).val()+',';
	});
	var data = {ids:ids.substr(0,ids.length-1),act:'send'};
	jQuery.ajax({
		async : false,
		type:"POST",url:form_url,data:data,
		beforeSend: function(){Acan.alert(Alang.ajax_start);},
		ajaxSend: function(){Acan.alert(Alang.ajax_send);},
		success: function(data){
			if(data==1){
				Acan.alert(Alang.send_success,1000);
				setTimeout('Acan.url.refresh()',1000);
			}else{
				Acan.alert(Alang.send_failed,1000);
			}
		}
	});
}
function push_list_edit(id,alias,status){
	var title = Alang.alias_edit;
	var html = '';
	html = Ahtml.tag('form',{method:'post',action:'',onsubmit:'alias_list_save();return false;','class':'alias_form'},
		Ahtml.tag('table',{'class':'-table'},
			Ahtml.tag('tr',{},Ahtml.tag('td',{},Alang.alias)+Ahtml.tag('td',{},Ahtml.tag('input',{type:'text',name:'save[alias]',value:alias})))+
			Ahtml.tag('tr',{},Ahtml.tag('td',{},Alang.status)+Ahtml.tag('td',{},Ahtml.radio({type:'radio',name:'save[status]'},{'1':Alang.start,'2':Alang.stop},status)))+
			Ahtml.tag('tr',{},Ahtml.tag('td',{colspan:'2'},
				Ahtml.tag('input',{type:'hidden',name:'save[id]',value:id})+
				Ahtml.tag('input',{type:'hidden',name:'acansave',value:1})+
				Ahtml.tag('input',{type:'submit',name:'',value:Alang.save})
			))+
			Ahtml.tag('tr',{},Ahtml.tag('td',{},'PING')+
				Ahtml.tag('td',{},
					Ahtml.tag('input',{type:'button',onclick:'alias_ping(\'baidu\','+id+')',value:Alang.baidu})+
					Ahtml.tag('input',{type:'button',onclick:'alias_ping(\'google\','+id+')',value:Alang.google})
				)
			)
		)
	);
	var obj=Object();
	obj.id='ajax_alias_list';
	obj["class"]='acan_win dis_none';
	obj.css={height:'150px',width:'200px'};
	obj._close={onclick:'Acan.close(\''+obj.id+'\')','class':'-close'};//关闭按钮
	Acan.base.win(obj,title,html);
}
function push_list_save(id,alias,status){
	var data = jQuery('.alias_form').serialize();
	var drr = jQuery('.alias_form').serializeArray(),dbj = {};
	for (var i in drr) {dbj[drr[i].name.replace('save[','').replace(']','')] = drr[i].value;};
	if(dbj.status==1){dbj.status = Alang.start;}else{dbj.status = Alang.stop;}
	var url = "http://"+Adomain.forum+'/'+dbj.alias.replace('{alias}',dbj.alias);
	jQuery.ajax({
		async : false,
		type:"POST",url:form_url,data:data,
		beforeSend: function(){Acan.alert(Alang.ajax_start);},
		ajaxSend: function(){Acan.alert(Alang.ajax_send);},
		success: function(data){
			if(data==1){
				var abj = jQuery('._alias_list .aid_'+dbj.id);
				abj.find('.alias').html('<a href="'+url+'" target="_blank" >'+dbj.alias+'</a>');
				abj.find('.status').text(dbj.status);
				Acan.alert(Alang.up_success,1000);
			}else{
				Acan.alert(Alang.no_change,1000);
			}
		}
	});
}